package com.wdhcr.osspolicy.enums;

import com.wdhcr.osspolicy.component.OssComponent;
import com.wdhcr.osspolicy.utils.SpringUtils;
import lombok.Getter;

import java.util.function.Function;

@Getter
public enum UrlConverterType {

    OSS(url -> {
        OssComponent ossComponent = SpringUtils.getBean(OssComponent.class);
        return ossComponent.getUrl(url);
    });


    private final Function<String, String> deserialize;

    UrlConverterType(Function<String, String> deserialize) {
        this.deserialize = deserialize;
    }
}
